url = 'https://www.acwing.com/problem/content/description/3548/'

T = int(input())
for _ in range(T):
    n, m = map(int, input().split())
    ans = 0
    for i in range(1, n + 1):
        if m % i == 0 and m // i <= n:
            ans += 1
    print(ans)